package com.dede.baselib;

import android.support.annotation.Nullable;

import com.dede.rxbase.dialog.StateDialog;
import com.dede.rxbase.rx.activity.RxActivityBase;

/**
 * 实现创建StateDialog的基类，项目中的基类只需要重写这些方法，就可以进行不同状态的切换
 *
 * @author hsh
 *         2018/1/9 13:41.
 */
public abstract class BaseActivity extends RxActivityBase {

    @Nullable
    @Override
    public StateDialog createErrorDialog() {
        return new StateDialog.Builder()
                .fullContent()
                .postEvent(true)
                .layout(R.layout.fragment_error)
                .builder();
    }

    @Nullable
    @Override
    public StateDialog createLoadingDialog() {
        return new StateDialog.Builder()
                .transparentBg()
                .setCancelable(true)
                .layout(R.layout.fragment_loading)
                .builder();
    }

    @Nullable
    @Override
    public StateDialog createEmptyDialog() {
        return new StateDialog.Builder()
                .fullContent()
                .postEvent(true)
                .layout(R.layout.fragment_empty)
                .builder();
    }
}
